package pattern.composite;

// 子菜单类
public class MenuItem extends MenuComponent {
    public MenuItem() {
    }
    public MenuItem(String name, int level) {
        this.name = name;
        this.level = level;
    }
    @Override
    public void print() {
        for (int i = 1; i < level; i++) {
            System.out.print("---");
        }
        System.out.println(name);
    }
}
